const entryHandler = (list) => {
  for (const entry of list.getEntries()) {
    let eventNames = [
      'click',
      'keydown',
      'touchstart',
      'pointerdown',
      'mousedown',
      'pointerup',
      'touchend',
      'mouseup'
    ]
    if (entry.entryType === 'event' && eventNames.includes(entry.name)) {
      const json = entry.toJSON()
      const reportData = {
        ...json,
        type: 'performance',
        subType: entry.name,
        pageUrl: window.location.href
      }
      // 发送数据 todo;
      lazyReportBatch(reportData)
    }
  }
}
// 统计和计算INP的时间（INP）
const observer = new PerformanceObserver(entryHandler)
// buffered: true 确保观察到所有paint事件
observer.observe({ type: 'event', buffered: true })
